package com.demo.springBoot2.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.demo.springBoot2.entity.UsersFriend;
import com.demo.springBoot2.entity.UsersInfo;
import com.demo.springBoot2.entity.dto.MyFriendAndInfoDTO;
import com.demo.springBoot2.entity.dto.UsersInfoLoginDTO;
import com.demo.springBoot2.mapper.UsersFriendMapper;
import com.demo.springBoot2.mapper.UsersInfoMapper;
import com.demo.springBoot2.service.IUsersFriendService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 好友关系 服务实现类
 * </p>
 *
 * @author wuHua·pl
 * @since 2024-03-16
 */
@Service
public class UsersFriendServiceImpl extends ServiceImpl<UsersFriendMapper, UsersFriend> implements IUsersFriendService {
    @Override
    public List<MyFriendAndInfoDTO> getUsersFriendByUserId(Integer userId) {
        return getBaseMapper().selectUserFriendsByUserId(userId);
    }

    @Override
    public List<MyFriendAndInfoDTO> getFriendByUserId(Integer userId) {
        System.err.println("好友"+getBaseMapper().selectFriendByUserId(userId));
        return getBaseMapper().selectFriendByUserId(userId);
    }

    @Override
    public UsersFriend selectFriend(UsersFriend usersFriend) {
        return getBaseMapper().selectFriend(usersFriend);
    }
}
